package com.mto.module.karaoke.portlet.util.comparator;

import com.liferay.portal.kernel.util.OrderByComparator;

public class SongComparatorFactoryUtil {

	public static OrderByComparator createOrderByComparator(String orderByCol, String orderByType) {
		final boolean orderByAsc = "asc".equalsIgnoreCase(orderByType);
		if("songId".equals(orderByCol)) {
			return new SongIdComparator(orderByAsc);
		}
		if("songName".equals(orderByCol)) {
			return new SongNameComparator(orderByAsc);
		}
		if("songAuthor".equals(orderByCol)) {
			return new SongAuthorComparator(orderByAsc);
		}
		if("songCategory".equals(orderByCol)) {
			return new SongCategoryComparator(orderByAsc);
		}
		if("songSinger".equals(orderByCol)) {
			return new SongSingerComparator(orderByAsc);
		}
		if("recordNumber".equals(orderByCol)) {
			return new RecordNumberComparator(orderByAsc);
		}
		if("modifiedDate".equals(orderByCol)) {
			return new ModifiedDateComparator(orderByAsc);
		}
		return null;
	}
}
